package com.lu.springboot01.controller;

import com.lu.springboot01.pojo.User;
import com.lu.springboot01.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

import java.util.List;

@Controller
public class UserTwoControler {
    @Autowired
    private UserService userService;

    public String test(Model model){
        List<User> all = userService.finall();
        String name = all.get(0).getName();
        model.addAttribute("username",name);
        return "hello";

    }
}
